package necer.ncalendardemo.activity;

import android.text.TextUtils;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by 12457 on 2017/8/21.
 */

public class LoadFileModel{


    public static void loadPdfFile(String url, Callback<ResponseBody> callback) {

        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("https://www.baidu.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        LoadFileApi mLoadFileApi = retrofit.create(LoadFileApi.class);
        if (!TextUtils.isEmpty(url)) {
            Call<ResponseBody> call = mLoadFileApi.loadPdfFile(url);
            call.enqueue(callback);
        }

    }


   /* QbSdk.preInit(this, new QbSdk.PreInitCallback() {
        @Override
        public void onCoreInitFinished() {

        }

        @Override
        public void onViewInitFinished(boolean b) {

        }
    });
    //tbs内核下载跟踪
        QbSdk.setTbsListener(this.tbsListener);
    //判断是否要自行下载内核
    boolean needDownload = TbsDownloader.needDownload(this, TbsDownloader.DOWNLOAD_OVERSEA_TBS);
        if (needDownload && isNetworkWifi(this)) {
        //isNetworkWifi(this)是我
        //自己写的一个方法，这里我也希望wifi下再下载
        TbsDownloader.startDownload(this);
    }*/
}
